<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>数据导入</title>
<link href="styles/general.css" rel="stylesheet" type="text/css" /><link href="styles/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/common.js"></script>
     <script type="text/javascript" src="js/sorttable.js"></script>
    <script src="js/utils.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/jquery/uploadify/jquery.min.js"></script>
	

<link rel="stylesheet" type="text/css" href="http://ajax.pupkk.com/dojo/1.7.5/dojo/resources/dojo.css" />
	<link rel="stylesheet" type="text/css" href="http://ajax.pupkk.com/dojo/1.7.5/dijit/themes/tundra/tundra.css" />
	<script src="http://ajax.pupkk.com/dojo/1.7.5/dojo/dojo.js" djConfig="parseOnLoad:true"></script>
    <script type="text/javascript">
		dojo.require("dojo.parser");
		dojo.require("dijit.form.DateTextBox");
		dojo.require("dijit.form.FilteringSelect");
		function goback()
		{
			window.location.href="importdata_show.do";
		}
		function save()
		{
			var datanumber = document.getElementById("datanumber").value;
			for(var i =1;i<=datanumber;i++)
			{
				if(dijit.byId("appnumber"+i).get('value')=="")
				{
					alert("请选择应用！");
					return false;
				}
			}
			$("input[type=submit]").val("正在提交。。。").attr("disabled",true);
			return true;
		}
	</script>
</head>

<body>
<h1>
        <span class="action-span"></span> <span
            class="action-span1"><a href="mainframe.jsp">
                首页</a> </span><span id="search_id" class="action-span1">- 数据导入</span>
    </h1>
   <!-- start ad menu list -->
   <form name="form1" id="form1" action="importdata_save.do" method="post" onsubmit="return save();">
   <input type="hidden" id="datanumber" name="datanumber" value="<s:property value="datalist.size()"/>"/>
   <input type="hidden" id="logmodel.filename" name="logmodel.filename" value="<s:property value="logmodel.filename"/>"/>
 	<input type="hidden" id="logmodel.refilename" name="logmodel.refilename" value="<s:property value="logmodel.refilename"/>"/>
 	<input type="hidden" id="logmodel.filesrc" name="logmodel.filesrc" value="<s:property value="logmodel.filesrc"/>"/>
    <div class="list-div" id="listDiv">
        <table width="100%" cellspacing="1" cellpadding="2" >
            <tbody>
                <tr>
                    <th height="20">日期</th>
                    <th>应用</th>
                    <th>版本</th>
				    <th>渠道</th>
				    <!-- <th>计费点</th> -->
				    <th>运营商</th>
				    <th>收入来源</th>
				    <!-- <th>省份</th> -->
				    <th>收入</th>
				    <th>新增用户</th>
				    <th>活跃用户</th>
				    <th>付费用户</th>
				    <th>付费次数</th>
                </tr>
                <s:if test="datalist.size()>0">
  				<s:iterator value="datalist" status="i"> 
  					 <tr>
                            <td style="background-color: rgb(255, 255, 255);">
                            <input id ="day<s:property value="#i.count"/>" name="day<s:property value="#i.count"/>" value="<s:property value="day"/>" size="10"/>
                            </td>
                            <td style="background-color: rgb(255, 255, 255);">
                             <select id="appnumber<s:property value="#i.count"/>" name="appnumber<s:property value="#i.count"/>" dojoType="dijit.form.FilteringSelect">
				               <option value="">--请选择--</option>
				               <s:iterator value="applist" status="stat">
				               <option value="<s:property value="appnumber" />" <s:if test="appnumber.equals(datalist.get(#i.count-1).appnumber)">selected</s:if>><s:property value="appname" /></option>
				               </s:iterator>
				             </select>
                            </td>
                            <td style="background-color: rgb(255, 255, 255);">
                             <select id="appversionnumber<s:property value="#i.count"/>" name="appversionnumber<s:property value="#i.count"/>" dojoType="dijit.form.FilteringSelect">
				               <option value="">--请选择--</option>
				               <s:iterator value="appversionlist" status="stat">
				               <option value="<s:property value="appversionnumber" />" <s:if test="appversionnumber.equals(datalist.get(#i.count-1).appversionnumber)">selected</s:if>><s:property value="appname" /></option>
				               </s:iterator>
				             </select>
                            </td>
                            <td style="background-color: rgb(255, 255, 255);">
                            <select id="channelid<s:property value="#i.count"/>" name="channelid<s:property value="#i.count"/>" dojoType="dijit.form.FilteringSelect">
				               <option value="-1">--请选择--</option>
				               <s:iterator value="channellist" status="stat">
				               <option value="<s:property value="id" />" <s:if test="id==channelid">selected</s:if>><s:property value="name" /></option>
				               </s:iterator>
				             </select>
                            </td>
						    <!-- <td style="background-color: rgb(255, 255, 255);">
						   		<input id ="goodsname<s:property value="#i.count"/>" name="goodsname<s:property value="#i.count"/>" value="<s:property value="goodsname"/>" size="10"/>
						    </td>  -->
						    <td style="background-color: rgb(255, 255, 255);">
						   			<input id ="operator<s:property value="#i.count"/>" name="operator<s:property value="#i.count"/>" value="<s:property value="operator" />" size="10"/>
						    </td>
						    <td style="background-color: rgb(255, 255, 255);">
						    	<input id ="source<s:property value="#i.count"/>" name="source<s:property value="#i.count"/>" value="<s:property value="source" />" size="10"/>
						    </td>
						   <!--  <td style="background-color: rgb(255, 255, 255);">
						    	<input id ="province<s:property value="#i.count"/>" name="province<s:property value="#i.count"/>" value="<s:property value="province" />" size="10"/>
						    </td> -->
						    <td style="background-color: rgb(255, 255, 255);">
						    	<input id ="fee<s:property value="#i.count"/>" name="fee<s:property value="#i.count"/>" value="<s:property value="%{formatfee(fee)}" />" size="10"/>
						    </td>
						     <td style="background-color: rgb(255, 255, 255);">
						    	<input id ="newusers<s:property value="#i.count"/>" name="newusers<s:property value="#i.count"/>" value="<s:property value="newusers" />" size="10"/>
						    </td>
						     <td style="background-color: rgb(255, 255, 255);">
						    	<input id ="activeuser<s:property value="#i.count"/>" name="activeuser<s:property value="#i.count"/>" value="<s:property value="activeuser" />" size="10"/>
						    </td>
						     <td style="background-color: rgb(255, 255, 255);">
						    	<input id ="payingcustomers<s:property value="#i.count"/>" name="payingcustomers<s:property value="#i.count"/>" value="<s:property value="payingcustomers" />" size="10"/>
						    </td>
						     <td style="background-color: rgb(255, 255, 255);">
						    	<input id ="paidnumber<s:property value="#i.count"/>" name="paidnumber<s:property value="#i.count"/>" value="<s:property value="paidnumber" />" size="10"/>
						    </td>
  					</tr>
  				</s:iterator>
  				</s:if>
  				<tr>
  					<td colspan="11" align="center">
  						<input type="submit" value=" 保存 " class="button" />
				        <input type="button" onclick="goback()" value=" 返回 " class="button" />
  					</td>
  				</tr>
  </tbody>
  </table>
  </div>
  </form>
 <!--Bottom开始-->
    <script language="JavaScript">

if (document.getElementById("listDiv"))
{
  document.getElementById("listDiv").onmouseover = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
        if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#eeeded';
      }
    }

  }

  document.getElementById("listDiv").onmouseout = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
          if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#FFF';
      }
    }
  }

}

    </script>
    
<div id="footer">
<br />
<s:property value="bottom"/></div>
    <!--Bottom结束-->
</body>
</html>